import request from '@/utils/request'

export function getList(params: any) {
  return request({
    url: '/dksb',
    method: 'get',
    params,
  })
}

export function getCourses(params: any) {
  return request({
    url: '/dksb/course',
    method: 'get',
    params,
  })
}

export function getReport(params: any) {
  return request({
    url: '/dksb/report',
    method: 'get',
    params,
  })
}

export function createReport(data: any) {
  return request({
    url: '/dksb/report',
    method: 'post',
    data,
  })
}

export function reCreateReport(id: string) {
  return request({
    url: `/dksb/report?id=${id}`,
    method: 'put',
  })
}

export function deleteReport(data: any) {
  return request({
    url: '/dksb/report',
    method: 'delete',
    data,
  })
}

export function getDownload(url: string) {
  return request({
    url: url,
    method: 'get',
    responseType: 'blob',
  })
}

export function checkRepeat(data: any) {
  return request({
    url: '/dksb/checkRepeat',
    method: 'post',
    data,
  })
}

export function doEdit(data: any) {
  return request({
    url: '/dksb',
    method: 'put',
    data,
  })
}

export function doDelete(data: any) {
  return request({
    url: '/dksb',
    method: 'delete',
    data,
  })
}

export function getOne(thirdNo: string) {
  return request({
    url: `/dksb/${thirdNo}`,
    method: 'get',
  })
}

export function doStatus(data: any) {
  return request({
    url: `/dksb/status/${data.status}`,
    method: 'put',
    data: data.thirdNos,
  })
}
